<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript" src="js/prototype.js"></script>
	<script type="text/javascript">
		//创建类
		var People = Class.create({
			initialize : function(name,age,sex){
				this.name = name;
				this.age = age;
				this.sex = sex;
			},
			say : function(){
				alert("你好，我是" + this.name + "今年" + this.age + "岁了" + "我是个" + this.sex + "生");
			},
			zhangyisui : function(){
				this.age ++;
			}
		});

		//子类
		var Student = Class.create(People, {
			initialize : function($super,name,age,sex,xuehao){
				$super(name,age,sex);
				//运行一次父亲的initialize
				this.xuehao = xuehao;
			}

		});
		 
		var chenwei = new Student("小明",12,"男",123);
		alert(chenwei.xuehao);
	</script>
</body>
</html>